<template>
<h1>el表单</h1>
  <el-form  label-width="80px" style="width: 500px" >
    <el-form-item label="用户名:">
        <el-input v-model="person.username" placeholder="请输入用户名"></el-input>
    </el-form-item>
    <el-form-item label="密码:">
      <el-input v-model="person.password" placeholder="请输入密码"></el-input>
    </el-form-item>
    <el-form-item label="性别:">
        <el-radio-group v-model="person.gender">
          <el-radio label="男" value="1"></el-radio>
          <el-radio label="女" value="0"></el-radio>
        </el-radio-group>
    </el-form-item>
    <el-form-item label="城市:">
      <el-form-item>
        <el-select v-model="person.city">
          <el-option label="武汉" value="wh"></el-option>
          <el-option label="成都" value="cd"></el-option>
          <el-option label="上海" value="sh"></el-option>
        </el-select>
      </el-form-item>
    </el-form-item>
    <el-form-item label="管理员">
      <el-switch v-model="person.isAdmain" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
    </el-form-item>
    <el-form-item>
      <el-button type="success" @click="show()">注册</el-button>
    </el-form-item>

  </el-form>


</template>

<script setup>
import {ref} from "vue";
const show = ()=>{
  console.log(person.value);
}
const person=ref({
  username:'',
  password:'',
  gender:'',
  city:'',
  isAdmain:''
})
</script>

<style scoped>

</style>